/* 自定义trim */
function trim (str) {  //删除左右两端的空格,自定义的trim()方法
  return str == undefined ? "" : str.replace(/(^\s*)|(\s*$)/g, "")
}

//获取url地址上面的参数 argname:'id'
function requestUrlParam(argname){
    //http://localhost:9090/backend/page/member/add.html?name=tom&id=2341234&age=18
    //name=tom
    //id=2341234
    //age=18
  var url = location.href;
  var arrStr = url.substring(url.indexOf("?")+1).split("&")
  for(var i =0;i<arrStr.length;i++)
  {
      var loc = arrStr[i].indexOf(argname+"=")
      if(loc!=-1){
          //arrStr[i]   2341234
          return arrStr[i].replace(argname+"=","").replace("?","")
      }
  }
  return ""
}
